import {ref} from 'vue'
import axios from 'axios';

export function useFetch(url,param){
    var data = ref(null);
    var error = ref(null);

    axios.post(url,param).
    then(function(response){
        data = response.data;
    }).catch(function(err){
        error = err;
    })

    return {data,error}; // {"data":data,"error":error}
}